package com.feihong.txgw.shopcar.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @name txgw_app
 * @class name：com.feihong.txgw.shopcar.bean
 * @class describe:
 * @author wangziheng
 * @time 2017/6/29 13:22
 * @change
 * @chang time
 * @class describe
 */
public class GoodsEntity implements Parcelable{

    /**
     *数据库中的主键
     */
    private String id;
    /**
     *  商品id
     */
    private String sku_id;
    /**
     * 商品名称
     */
    private String sku_name;
    /**
     * 商品属性
     */
    private String spec;
    /**
     * 描述（）
     */
    private String subtitle;
    private String sn;
    /**
     * 商品价格
     */
    private String shop_price;
    /**
     * 库存量
     */
    private String number;
    /**
     * 购物车中的数量
     */
    private String nums;
    /**
     * 商品图片
     */
    private String thumb;
    /**
     * 1 正常   0 下架  -1 店主删除本店商品
     */
    private String status;
    /**
     *
     */
    private String spu_status;
    /**
     * 选中状态
     */
    private boolean isCheck;

    /**
     * 买家留言
     */
    private String suggestMsg;

    public GoodsEntity(){}

    public GoodsEntity(String id, String sku_id, String sku_name, String spec, String subtitle, String sn, String shop_price, String number, String nums, String thumb, String status, String spu_status, boolean isCheck, String suggestMsg) {
        this.id = id;
        this.sku_id = sku_id;
        this.sku_name = sku_name;
        this.spec = spec;
        this.subtitle = subtitle;
        this.sn = sn;
        this.shop_price = shop_price;
        this.number = number;
        this.nums = nums;
        this.thumb = thumb;
        this.status = status;
        this.spu_status = spu_status;
        this.isCheck = isCheck;
        this.suggestMsg = suggestMsg;
    }

    protected GoodsEntity(Parcel in) {
        id = in.readString();
        sku_id = in.readString();
        sku_name = in.readString();
        spec = in.readString();
        subtitle = in.readString();
        sn = in.readString();
        shop_price = in.readString();
        number = in.readString();
        nums = in.readString();
        thumb = in.readString();
        status = in.readString();
        spu_status = in.readString();
        isCheck = in.readByte() != 0;
        suggestMsg = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(sku_id);
        dest.writeString(sku_name);
        dest.writeString(spec);
        dest.writeString(subtitle);
        dest.writeString(sn);
        dest.writeString(shop_price);
        dest.writeString(number);
        dest.writeString(nums);
        dest.writeString(thumb);
        dest.writeString(status);
        dest.writeString(spu_status);
        dest.writeByte((byte) (isCheck ? 1 : 0));
        dest.writeString(suggestMsg);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GoodsEntity> CREATOR = new Creator<GoodsEntity>() {
        @Override
        public GoodsEntity createFromParcel(Parcel in) {
            return new GoodsEntity(in);
        }

        @Override
        public GoodsEntity[] newArray(int size) {
            return new GoodsEntity[size];
        }
    };

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSku_id() {
        return sku_id;
    }

    public void setSku_id(String sku_id) {
        this.sku_id = sku_id;
    }

    public String getSku_name() {
        return sku_name;
    }

    public void setSku_name(String sku_name) {
        this.sku_name = sku_name;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getShop_price() {
        return shop_price;
    }

    public void setShop_price(String shop_price) {
        this.shop_price = shop_price;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getNums() {
        return nums;
    }

    public void setNums(String nums) {
        this.nums = nums;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSpu_status() {
        return spu_status;
    }

    public void setSpu_status(String spu_status) {
        this.spu_status = spu_status;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public String getSuggestMsg() {
        return suggestMsg;
    }

    public void setSuggestMsg(String suggestMsg) {
        this.suggestMsg = suggestMsg;
    }
}
